import request from "../utils/request";
import cache from "../utils/cache";
import Vue from "vue";

export function filterDiseases() {
  const url = window.$mock
    ? "/mock/filterDiseases.json"
    : "/monitor_warning/bjcdc/riskModel/filterDiseases";

  return request({
    url,
    method: "get",
  });
}

// export function filterDiseases() {
//     const url = window.$mock ? '/mock/filterDiseases.json' : '/bjcdc/riskModel/filterDiseases'

//     return request({
//         url,
//         method: 'get',
//     })
// }

export function indexCard(params) {
  const url = window.$mock
    ? "/mock/indexCard.json"
    : "/monitor_warning/bjcdc/riskModel/index";

  /*
    origin_area=HN
    &destination_area=CN
    &date=2025-06-30
    &disease=55fc0aa52e1bfebbbec3e6cbff9c09e3
    */
  return request({
    url,
    method: "get",
    params,
  });
  //   return Vue.http.get(url);
}

export function trendArea(params) {
  const url = window.$mock
    ? "/mock/trendArea.json"
    : "/monitor_warning/bjcdc/riskModel/trendArea";
  /*
    destination_area=CN
    &date=2025-06-30
    &ruleId=55fc0aa52e1bfebbbec3e6cbff9c09e3
    */
  return request({
    url,
    method: "get",
    params,
  });
}

export function trendByArea() {
  const url = window.$mock
    ? "/mock/trendByArea.json"
    : "/monitor_warning/bjcdc/riskModel/trendByArea?origin_area=HN&destination_area=CN&date=2025-06-30&ruleId=55fc0aa52e1bfebbbec3e6cbff9c09e3";

  return request({
    url,
    method: "get",
  });
}

export function mpoxCaseDeathFlightCount(params) {
  const url = window.$mock
    ? "/mock/trendByArea.json"
    : "/epinews/riskModel/mpoxCaseDeathFlightCount";

  return request({
    url,
    method: "get",
    params,
  });
}

//http://localhost:8081/bjcdc/riskModel/listPage
export function listPage(data) {
  const url = window.$mock
    ? "/mock/listPage.json"
    : "/monitor_warning/bjcdc/riskModel/listPage";

  return request({
    url,
    method: "post",
    data,
  });
}
